import java.util.Scanner;

public class Demo5 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		System.out.println("输入一个整数 ");
		int num = sc.nextInt();
		int max = num;
		int min = num;
		while (num != 0) {
			if (num > max) {
				max = num;
			} else if (num < min) {
				min = num;
			}
			System.out.println("输出");
			num = sc.nextInt();
		}
		System.out.println("最大值" + max + "最小值" + min);
	}

}
